/**
 * @FileName Client.java
 * @Package com.designMode.mediator
 * -------------------------------------
 * @function Please write description of function
 * @Date 2016-1-5 下午5:13:27
 * -------------------------------------
 * Copyright (c) 2016,顾博君 All Rights Reserved.
 */
package com.designMode.mediator;

/**
 * @author 顾博君
 * @ClassName Client
 * @Date 2016-1-5 下午5:13:27
 * @Function 场景类
 */
public class Client {
    public static void main(String[] args) {
        // 中介者
        ConcreteMediator mediator = new ConcreteMediator();
        // 同事1
        ConcreteColleague1 c1 = new ConcreteColleague1(mediator);
        // 同事2
        ConcreteColleague2 c2 = new ConcreteColleague2(mediator);
        // 中介者可以找到同事1和同事2
        mediator.setC1(c1);
        mediator.setC2(c2);

        c1.selfMethod();
        // 同事1去找中介者
        c1.depMethod();
        c2.selfMethod();
        // 同事2去找中介者
        c2.depMethod();
    }
}
